home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Diskmonitors / DiskEd11 / ded.doc < prev    next >
Text File  |  1996-09-26  |  19KB  |  680 lines

  1.  
  2.  
  3.                  Disk-Editor, Version 1.1, User documentation
  4.                              Edition 3-Nov-1993
  5.                     Copyright 1992,3 Misoftware Computing
  6.  
  7.  
  8.  
  9.  
  10. 1. I'm sorry for my bad English.
  11. --------------------------------
  12.  
  13. 2. Requirements
  14. ---------------
  15.  
  16.    Hardware:
  17.  
  18.    An  AMIGA, Version 1.2 or higher (tested on 1.3, 2.0 and 3.0, next version
  19. will be 2.0+ only), NTSC or PAL, cca 100KB of memory free, 5 bytes per sector
  20. for  bitmap (for standard floppy format it's about 8800 bytes), 512 bytes for
  21. sector data, some memory for CD, drive, disk...
  22.  
  23.  
  24.    Software:
  25.  
  26.    Arp  library,  Req  or Reqtools library.  If you want nicer design, you need
  27. Reqtools library.  If DED is unable to open it, it will use Req, but the design
  28. has been made for Reqtools.
  29.  
  30.  
  31. 3. Design
  32. ---------
  33.  
  34.    On  the  screen title, there is the program version and number of sectors in
  35. memory  displayed.   In  the  bottom  of  the  screen,  there  is a status line
  36. containing  type  of  current sector, position in it, its number, its flags and
  37. total free memory.
  38.  
  39. 3.1 Type
  40.  
  41.    Program recognises 21 types of sectors:  BOOT, ROOT, USERDIR, FHEADER, EXT.,
  42. DATA,  BITMAP,  DIRCACHE,  LDIR, LFILE, LSEG, FSHD, PART., BAD BLK, RIGID, BMAP
  43. EXT,???, SUSPECT, BITMAP?, FREE, DATA?
  44.  
  45. BOOT     - Bootblock
  46. ROOT     - Rootblock
  47. USERDIR  - User directory
  48. FHEADER  - File header
  49. EXT.     - Extension of file header
  50. DATA     - Data block
  51. BITMAP   - Bitmap block
  52. DIRCACHE - Directory  cache  block (introduced in  OS V39, DED may  handle them
  53.            under any OS version including 1.2)
  54. LDIR     - Linked directory (introduced in  OS V36, DED may  handle  them under
  55.            any OS version including 1.2)
  56. LFILE    - Linked fileheader (introduced in  OS V36, DED may  handle them under
  57.            any OS version including 1.2)
  58. LSEG     - Load segment block
  59. FSHD     - Filesystem header block
  60. PART.    - Partition block
  61. BAD BLK  - Replacement of bad block
  62. RIGID    - Disk rigid block
  63. BMAP EXT - Bitmap extension block
  64.  
  65. ???      - Unknown type, but may be free (use "Load root & bitmap" for correct
  66.            identification)
  67. SUSPECT  - Unknown type, but allocated or something very suspicious
  68. BITMAP?  - Sector can be a bitmap
  69. FREE     - Free block
  70. DATA?    - May be  a  FFS data  block (use "Load  root  &  bitmap" for correct
  71.            identification)
  72.  
  73. 3.2 Position in block
  74.  
  75.    Format  of  numbers:  there are six numbers, separated by slashes:  pos in
  76. bytes  in  dec/pos  in words in dec/pos in longs in dec space pos in bytes in
  77. hex/pos in words in hex/pos in longs in hex.
  78.  
  79.    If you edit bitmap block in DOS edit mode, the number of the sector, pointed
  80. to by mouse, is displayed here, instead.
  81.  
  82. 3.3 Block
  83.  
  84.    Number of block, pointed to by the cursor.
  85.  
  86. 3.4 Sector flags
  87.  
  88. 1st character: Sector is changed   *=changed, #=not changed
  89. 2nd character: Sector is selected  +=selected, #=not selected
  90. 3rd character: Checksum            G=good, B=bad, Nothing=has no checksum
  91. 4th character: Status              B=Busy
  92.  
  93. 3.5 Free memory
  94.  
  95.    Current amount of total free memory.
  96.  
  97.  
  98. 4. Control
  99. ----------
  100.  
  101.  DED can be controlled using:
  102.  
  103.   - menus
  104.  
  105.   - cursor keys - move the cursor by one position in some way
  106.  
  107.   - up and down arrows with shift - move the cursor by one screen
  108.  
  109.   - up and down arrows with alt - move the cursor by 12 lines
  110.  
  111.   - left and right arrows with alt - move the cursor by one byte
  112.  
  113.   - TAB key - switches between ASCII and number edit modes
  114.  
  115.   - CTRL and up/down/left/right - hotkeys for
  116.       Parent/Descendant/Previous object/Next object menu functions
  117.  
  118.   -  F-key  functions - If you press CTRL + one of the F-keys, you may set your
  119. own  ASCII-code  of  this F-key.  But this code is valid only in the edit mode.
  120. CTRL  +  SHIFT + one of the F-keys => you will have to enter sector number.  If
  121. you  press  SHIFT  and  this F-key, DED will jump on sector you defined before.
  122. You can clear the sector number by entering empty string or -1.
  123.  
  124.  
  125.    In  number  gadgets,  you can enter an expression.  Expressions can contain
  126. numbers,  operators  (see  the  table  below),  variables (a-z), $ followed by
  127. hexadecimal  number,  <  (means:   minimal  allowed value), > (maximal allowed
  128. value).   If  you want to set a variable, you must use the calculator function
  129. to do it.
  130.  
  131.    Operators: (sorted by priority)
  132.  
  133.     *,/        multiplication, division
  134.     +,-        addition, subtraction
  135.     &          logical AND
  136.     ^,|        logical XOR and OR
  137.  
  138.    Control in DOS edit mode:
  139.  
  140.     - CTRL and up/down/left/right - hotkeys for
  141.         Parent/Descendant/Previous object/Next object menu functions
  142.  
  143.     - up or left - same as menuitem "Previous sector"
  144.  
  145.     - down or right - same as menuitem "Next sector"
  146.  
  147.     - menuitem "Jump to byte ..." is changed to "Jump to bitmap flag of sector
  148.       ..."
  149.  
  150.     - You may change any information (including sector type) by clicking on it.
  151.       You  cannot change BOOT, BITMAP, FREE and DATA? sector types and the ROOT
  152.       type can be switched only between ROOT and SUSPECT types.
  153.  
  154.     - SHIFT + F-key functions (see above)
  155.  
  156.     - up and down arrows with shift - scroll the display
  157.  
  158. 5. Testing
  159. ----------
  160.  
  161.    This  version  has  been written on AMIGA 500 with 2MB of RAM, one external
  162. disk drive and system 1.3.
  163.  
  164.  Tested on:
  165.  
  166.      My AMIGA
  167.      AMIGA 500+ with 6 MB of RAM, 50MB hard disk and kickstart 2.0
  168.      AMIGA 500 with 1MB of chip and 1MB of fast RAM, one external drive
  169.         and a 45 MB hard-disk.
  170.      AMIGA 1200 with 2 MB of CHIP-RAM, 80MB hard disk
  171.  
  172.  
  173. 6. Miscellaneous
  174. ----------------
  175.  
  176.    This  program  is freely distributable, but the copyright remains with the
  177. author at all times.  It's provided "as is"; no warranties are made.  All use
  178. Is at your own risk, and no liability or responsibility is assumed.
  179.  
  180.    This  is a first public released version.  Here are still some unknown bugs,
  181. but I don't know where.  If you know some, please write to:
  182.  
  183.      Internet E-mail:
  184.             lemming@k332.feld.cvut.cz
  185.  
  186.          or Michal Kara
  187.             Krosenska 543
  188.             Praha 8-Troja
  189.             181 00
  190.             Czech republic
  191.  
  192.  
  193.    If  you  call DED from CLI, you can also specify mounted device by giving it
  194. as an argument - for example "ded df0:".
  195.  
  196.  
  197. 7. Thanks
  198. ---------
  199.  
  200.    Thanks  to  Martin Mares of MJSoft System Software for testing, critics and
  201. some information about AMIGA system,
  202.  
  203.    Pavel Troller of SinSoft for language censoring,
  204.  
  205.    Honza Kratochvil ("LACE") for testing and some ideas
  206.  
  207.    and Petr Cisar (PCSoft) & "mr. Zub" for risking integrity of their hards.
  208.  
  209.  
  210.    No thanks to PC for its existency.
  211.  
  212.  
  213. 8. History
  214. ----------
  215.  
  216.    History is stored in the ded.history file.
  217.  
  218.  
  219. 9. Plans for future
  220. -------------------
  221.  
  222.  - Check and repair disk (The Re-hash function in this version has some
  223.    repairing effects...)
  224.  
  225.  - Recover actions
  226.  
  227.  - User selectable screen mode
  228.  
  229.  - Wildcards in search
  230.  
  231.  - Optimize the code
  232.  
  233.  - Dynamic bitmap of sectors (less than 5 bytes for every sector)
  234.  
  235.  - Variable length of block
  236.  
  237.  - The next release will be probably 2.0+ only (some 2.0+ features will be
  238.    added)
  239.  
  240.  - Use only reqtools.library, no req
  241.  
  242. 10. Appendixes
  243. --------------
  244.  
  245.                                 APPENDIX A
  246.                               DOS STRUCTURES
  247.  
  248. (Thanks to Martin Mares for most of these structures)
  249.  
  250. Here  are  dos  structures  for  the  Old  File  System (OFS), offsets are in
  251. longs:
  252.  
  253. ROOT BLOCK:
  254.  
  255. This block is in the middle of the medium. It's the root directory.
  256.  
  257. 0 T.SHORT (=2)
  258. 1 0
  259. 2 0
  260. 3 HASH TABLE SIZE
  261. 4 0
  262. 5 CHECKSUM
  263. 6 HASH TABLE
  264. ...
  265. SIZE-50 BITMAP FLAG (TRUE=BITMAP IS VALID)
  266. SIZE-49 BITMAPBLOCKS
  267. ...
  268. SIZE-24 BITMAP EXTENSION BLOCK
  269. SIZE-23 DAYS LAST ACCESS
  270. SIZE-22 MINS LAST ACCESS
  271. SIZE-21 TICKS LAST ACCESS
  272. SIZE-20 DISK NAME
  273. ...
  274. SIZE-7 CREATE DAYS
  275. SIZE-6 CREATE MINS
  276. SIZE-5 CREATE TICKS
  277. SIZE-4 0
  278. SIZE-3 0
  279. SIZE-2 FIRST DIRECTORY CACHE BLOCK
  280. SIZE-1 ST.ROOT (=1)
  281.  
  282.  
  283. USER DIR:
  284.  
  285. 0 T.SHORT (=2)
  286. 1 POINTER TO SELF
  287. 2 0
  288. 3 0
  289. 4 0
  290. 5 CHECKSUM
  291. 6 HASH TABLE
  292. ...
  293. SIZE-50 NOT USED
  294. SIZE-48 PROTECTION BITS
  295. SIZE-47 0
  296. SIZE-46 COMMENT
  297. ...
  298. SIZE-23 DAYS LAST ACCES
  299. SIZE-22 MINS LAST ACCES
  300. SIZE-21 TICKS LAST ACCES
  301. SIZE-20 DIRECTORY NAME
  302. ...
  303. SIZE-11 PREVIOUS BLOCK IN LINK-LIST - This value is always NULL.
  304. SIZE-10 NEXT BLOCK IN LINK-LIST
  305. SIZE-4 HASH CHAIN (NEXT ENTRY WITH SAME HASH VALUE)
  306. SIZE-3 PARENT DIRECTORY
  307. SIZE-2 FIRST DIRECTORY CACHE BLOCK
  308. SIZE-1 ST.USERDIR (=2)
  309.  
  310.  
  311. FILE HEADER:
  312.  
  313. 0 T.SHORT (=2)
  314. 1 POINTER TO SELF
  315. 2 # OF DATA BLOCKS IN THIS PART
  316. 3 0
  317. 4 1.ST DATA BLOCK
  318. 5 CHECKSUM
  319. 6 ...
  320.  
  321. DATABLOCKS-
  322. SIZE-52 2nd DATA BLOCK
  323. SIZE-51 1ST DATA BLOCK
  324. SIZE-50 NOT USED
  325. SIZE-48 PROTECTION BITS
  326. SIZE-47 BYTE SIZE
  327. SIZE-46 COMMENT
  328. ...
  329. SIZE-23 DAYS LAST ACCES
  330. SIZE-22 MINS LAST ACCES
  331. SIZE-21 TICKS LAST ACCES
  332. SIZE-20 FILE NAME
  333. ...
  334. SIZE-11 PREVIOUS BLOCK IN LINK-LIST - This value is always NULL.
  335. SIZE-10 NEXT BLOCK IN LINK-LIST
  336. SIZE-4 NEXT ENTRY WITH SAME HASH VALUE
  337. SIZE-3 PARENT DIRECTORY
  338. SIZE-2 POINTER TO EXTENSION OR NULL
  339. SIZE-1 ST.FILE (=-3)
  340.  
  341.  
  342. EXTENSION OF FILE HEADER:
  343.  
  344. 0 T.LIST (=16)
  345. 1 POINTER TO SELF
  346. 2 # OF DATA BLOCKS IN THIS PART
  347. 3 0
  348. 4 0
  349. 5 CHECKSUM
  350. 6 ...
  351.  
  352. DATABLOCKS-
  353. SIZE-52 2nd DATA BLOCK
  354. SIZE-51 1ST DATA BLOCK
  355. SIZE-50 NOT USED
  356. SIZE-4 0
  357. SIZE-3 FILE HEADER
  358. SIZE-2 POINTER TO EXTENSION OR NULL
  359. SIZE-1 ST.FILE (=-3)
  360.  
  361.  
  362. DATA BLOCK:
  363.  
  364. 0 T.DATA (8)
  365. 1 POINTER TO FILE HEADER
  366. 2 NUMBER IN FILE (1ST,2ND,20TH DATA BLOCK)
  367. 3 DATA SIZE
  368. 4 NEXT DATA BLOCK OR NULL
  369. 5 CHECKSUM
  370. 6 DATA
  371. ...
  372.  
  373. BITMAP EXTENSION BLOCK:
  374.  
  375.    If  there's  more than 25 bitmap sectors, pointers to next bitmap blocks are
  376. stored  in this block.  All longs (except the last one) are used as pointers to
  377. the  bitmap blocks.  Last long points to the next BITMAP EXTENSION BLOCK (if it
  378. exists).
  379.  
  380.    0 BITMAP BLOCK POINTERS
  381.    ...
  382.    SIZE-1 NEXT BITMAP EXTENSION BLOCK
  383.    
  384.  
  385. BITMAP:
  386.  
  387.    Bitmap is stored in longs.  The bootblocks are not stored in the bitmap.  If
  388. there  are  two bootblocks, the first bit (Bit #0) of the first long of data is
  389. for  sector #2.  The second bit (bit #1) of the third long is for sector #67...
  390. If  the bit is clear, sector is allocated.  In dos edit mode, DED converts this
  391. user  unfriendly  defined  rule  so  sectors are displayed consecutively on the
  392. screen.
  393.  
  394. 0 CHECKSUM
  395. 1 DATA
  396. ...
  397.  
  398.  
  399. For  Fast  File  System  (FFS) it's the same, but data block contain only data
  400. (512 bytes).
  401.  
  402. DIRECTORY CACHE BLOCK:
  403. 0 (21)
  404. 1 SELFPOINTER
  405. 2 POINTER TO DIRECTORY
  406. 3 NUMBER ITEMS STORED IN THIS BLOCK
  407. 4 NEXT DIRECTORY CACHE BLOCK
  408. 5 CHECKSUM
  409. 6 - FIRST RECORD
  410.  
  411.   RECORD STRUCTURE: ( !!! OFFSETS ARE IN BYTES !!! )
  412.  
  413. 0 POINTER TO FILEHEADER OR USERDIR OF THIS RECORD
  414. 4 SIZE OF FILE
  415. 8 PROTECTION BITS
  416. 12 0
  417. 16 DAYS LAST ACCES
  418. 18 MINS LAST ACCES
  419. 20 TICKS LAST ACCES
  420. 22 RECORD TYPE ($FD=FILE, $FC=LINKED FILE, $02=DIR, $04=LINKED DIR)
  421. 23 NAME (BSTR)
  422.    COMMENT (BSTR)
  423.    THERE MAY BE NULL BYTE (FOR WORD-ALIGNMENT)
  424.  
  425.  
  426. LINKED FILE:
  427. 0 T.SHORT (=2)
  428. 1 SELFPOINTER
  429. 2 0
  430. 3 0
  431. 4 0
  432. 5 CHECKSUM
  433. SIZE-23 DAYS LAST ACCESS
  434. SIZE-22 MINS LAST ACCESS
  435. SIZE-21 TICKS LAST ACCESS
  436. SIZE-20 FILE NAME
  437. ...
  438. SIZE-11 PREVIOUS BLOCK IN LINK-LIST
  439. SIZE-10 NEXT BLOCK IN LINK-LIST
  440. SIZE-4 NEXT ENTRY WITH SAME HASH VALUE
  441. SIZE-3 PARENT DIRECTORY
  442. SIZE-1 ST.LINKED FILE (=-4)
  443.  
  444.  
  445. LINKED DIRECTORY:
  446. 0 T.SHORT (=2)
  447. 1 POINTER TO SELF
  448. 2 0
  449. 3 0
  450. 4 0
  451. 5 CHECKSUM
  452. ...
  453. SIZE-23 DAYS LAST ACCESS
  454. SIZE-22 MINS LAST ACCESS
  455. SIZE-21 TICKS LAST ACCESS
  456. SIZE-20 DIRECTORY NAME
  457. ...
  458. SIZE-11 PREVIOUS BLOCK IN LINK-LIST
  459. SIZE-10 NEXT BLOCK IN LINK-LIST
  460. SIZE-4 NEXT ENTRY WITH SAME HASH VALUE
  461. SIZE-3 PARENT DIRECTORY
  462. SIZE-1 ST.LINKED USERDIR (=4)
  463.  
  464.  
  465. The  following  structures  and  texts were taken from the devices/hardblocks.i
  466. include file.
  467.  
  468.    Next  types  are  blocks  of data that exist on a hard disk to describe that
  469. disk.  They are not generically accessable to the user as they do not appear on
  470. any  DOS  drive.   The blocks are tagged with a unique identifier, checksummed,
  471. and linked together.  The root of these blocks is the RigidDiskBlock.
  472.  
  473.    The   RigidDiskBlock   must   exist   on   the   disk   within   the   first
  474. RDB_LOCATION_LIMIT  blocks.   This  inhibits the use of the zero cylinder in an
  475. AmigaDOS   partition:    although   it   is  strictly  possible  to  store  the
  476. RigidDiskBlock  data  in  the  reserved  area  of a partition, this practice is
  477. discouraged  since  the  reserved  blocks  of  a  partition  are overwritten by
  478. "Format", "Install", "DiskCopy", etc.  The recommended disk layout, then, is to
  479. use  the  first  cylinder(s)  to  store  all  the drive data specified by these
  480. blocks:  i.e.  partition descriptions, file system load images, drive bad block
  481. maps, spare blocks, etc.
  482.  
  483.    NOTE:   Optional  block addresses below contain $FFFFFFFF to indicate a NULL
  484. address.
  485.  
  486.  
  487. Rigid disk block:
  488.  
  489. 0  ID - text "RDSK"
  490. 1  Size of this checksummed structure (in longs)
  491. 2  Block checksum
  492. 3  SCSI Target ID of host
  493. 4  Size of disk blocks (in bytes)
  494. 5  Flags  -  Bit  0  =  no  disks exist to be configured after this one on this
  495.                         controller
  496.              Bit  1  =  no LUNs exist to be configured greater than this one at
  497.                         this SCSI Target ID
  498.              Bit 2 = no Target IDs exist to be configured greater than this one
  499.                      on this SCSI bus
  500.              Bit 3 = don't bother trying to perform reselection when talking to
  501.                      this drive
  502.              Bit 4 = Disk identification valid
  503.              Bit 5 = Controller identification valid
  504.              Bit 6 = Drive supports scsi synchronous mode - CAN BE DANGEROUS TO
  505.                      USE IF IT DOESN'T! (added 20-Jul-89)
  506.  
  507. 6  Optional bad block list
  508. 7  Optional first partition block (PART)
  509. 8  Optional fule system header block (FSHD)
  510. 9  Optional  drive-specific  init  code  *DriveInit(lun,rdb,ior):   "C"  stk  &
  511.    d0/a0/a1)
  512. 10 Six longs sets to -1
  513. 15 Number of drive cylinders
  514. 17 Sectors per track
  515. 18 Number of drive heads
  516. 19 Interleave
  517. 20 Landing zone cylinder (would be negative number)
  518. 21 Three unused longs
  519. 24 Starting cylinder: write precompensation
  520. 25 Starting cylinder: reduced write current
  521. 26 Drive step rate
  522. 27 Five unused longs
  523. 32 Low block of range reserved for hardblocks
  524. 33 High block of range for these hardblocks
  525. 34 Low cylinder of partitionable disk area
  526. 35 High cylinder of partitionable data area
  527. 36 Number of blocks available per cylinder
  528. 37 Seconds needed for autopark - zero for no auto park
  529. 38 Highest block used by RDSK (Not including replacement bad blocks)
  530. 39 One unused long
  531. 40 Two longs for disk vendor
  532. 42 Four longs for disk product
  533. 45 One long for disk revision
  534. 47 Two longs for controller vendor
  535. 49 Four longs for controller product
  536. 53 One long for controller revision
  537. 54 Ten unused longs
  538.  
  539.  
  540. Bad block(s) block:
  541.  
  542. 0 ID - text "BADB"
  543. 1 Size of this checksummed structure (in longs)
  544. 2 Block checksum
  545. 3 SCSI Target ID of host
  546. 4 Block number of the next Bad block(s) block (link)
  547. 5 One unused long
  548. 6 There are block pairs - First long  - pointer to bad block to replace to 
  549.                           Second long - pointer to good block which replaces it
  550.  
  551.  
  552. Partition block:
  553.  
  554. 0  ID - text "PART"
  555. 1  Size of this checksummed structure (in longs)
  556. 2  Block checksum
  557. 3  SCSI Target ID of host
  558. 4  Block number of the next Partition block (or -1)
  559. 5  Flags - Bit 0 = This partition is bootable
  560.            Bit 1 = Do not automount this partition (e.g.  manually mounted, but
  561.                    space reserved here)
  562. 6  Two reserved longs
  563. 8  Preferred flags for OpenDevice
  564. 9  Eight longs for BSRT device name (e.g. DH0)
  565. 17 Fiveteen unused longs
  566.  
  567.    The   following   structure   (dos   environment)   was   taken   from   the
  568. dos/filehandler.i include file (but Partition block structure continuing!).
  569.  
  570. 32 Size of table (in long without this, usually 16)
  571. 33 Size of block in longs
  572. 34 Sector org (??? - doc says that it's unused, set to 0)
  573. 35 Surfaces = number of heads
  574. 36 Sectors per block (not used, set to 1)
  575. 37 Number of blocks per track
  576. 38 Number  of  blocks  reserved  by  DOS  at  the start of the  partition (e.g.
  577.    bootblock)
  578. 39 Number of blocks reserved by DOS at the end of the partition (mostly zero)
  579. 40 Interleave
  580. 41 Starting cylinder of the partition
  581. 42 Last cylinder of the partition
  582. 43 Initial number of DOS buffers
  583. 44 Type of memory to allocate for buffers
  584. 45 Max number of bytes to transfer at a time
  585. 46 Address mask to block out certain memory (usually $FFFFFE)
  586. 47 Boot priority
  587. 48 Dos  type  ASCII  (HEX) string  showing filesystem type (like in bootblock):
  588.    0x444F5300 is old filesystem
  589.    0x444F5301 is fast file system
  590. 49 Fiveteen reserved longs
  591.  
  592.  
  593. File system header:
  594.  
  595. 0  ID text "FSHD"
  596. 1  Size of this checksummed structure (in longs)
  597. 2  Block checksum
  598. 3  SCSI Target ID of host
  599. 4  Size of disk blocks (in bytes)
  600. 5  Flags - No flags defined (???)
  601. 6  Two reserved longs
  602. 8  Dos  type  ASCII  (HEX) string  showing filesystem type (like in bootblock):
  603.    0x444F5300 is old filesystem
  604.    0x444F5301 is fast file system
  605. 9  Two words specifying release version of this code
  606. 10 Patching flags for next nine (or in future more) entries specifies, which of
  607.    these have to be patched to the device structure.  Bit 0 = patch Device node
  608.    type,  bit  7  =  patch  Segment list ..., $180 to patch Segment list Global
  609.    vector.
  610.  
  611.    The  following  (device node) structure was taken from the dos/filehandler.i
  612. include file (but File system header block structure continuing!).
  613.  
  614. 11 Type - always 0 for dos "devices"
  615. 12 CPTR  to  task.   If this  is null when the node is accesses, a task will be
  616.    started up
  617. 13 BPTR to lock - not used for devices - leave null
  618. 14 BSTR Handler - filename to loadseg (if seglist is null)
  619. 15 Stacksize to use when starting task
  620. 16 Task priority when starting task
  621. 17 BPTR to startup msg: FileSysStartupMsg for disks
  622. 18 Pointer to first Load file system segment (LSEG) block.
  623. 19 BPTR to global vector - BCPL global  vector to use when starting a task.  -1
  624. means that the Segment list (see long 19) is not for a bcpl program, so the dos
  625. won't  try and construct one.  0 tell the dos that you obey BCPL linkage rules,
  626. and that it should construct a global vector for you.
  627. 20 Twenty three reserved longs
  628. 43 Twenty one reserved longs
  629.  
  630.  
  631. Load file system segment (these block contains filesystem):
  632.  
  633. 0 ID - text "LSEG"
  634. 1 Size of this checksummed structure (in longs)
  635. 2 Block checksum
  636. 3 SCSI Target ID of host
  637. 4 Block number of the next Load file system segment block (link)
  638. 5 There is 123 longs of data
  639. ...
  640.  
  641.  
  642.                                 APPENDIX B
  643.                            THE HASHING FUNCTION
  644.  
  645.    Hashing  is  a very good way to speed up the disk access.  In AmigaDos, it's
  646. used  in  directories  (including ROOT).  One block contains 72 hashchains.  If
  647. some  items  have  the same hash value, the long in the directory points to the
  648. first  block,  the  entry  'next entry with same hash value' of the first block
  649. points to the second block...
  650.  
  651.    HASH_VALUE  is number of long, where the number of block is stored in, name
  652. is the name of object and name[n] is the n-th character of the string.
  653.  
  654. HASH_VALUE=f(STRLEN[name]) MOD 72 + 6
  655.  
  656.       f(0)=STRLEN(name)
  657.       f(n)=13*f(n-1)+TOUPPER(name[n])
  658.  
  659.    Here is source of hashing function.
  660. INPUT:  A0 = String to hash value compute to
  661. OUTPUT: D0 = Hash value
  662.  
  663. hash_fn    move.l    a0,-(a7)
  664.     moveq    #-1,d1
  665. 1$    add.l    #1,d1
  666.     tst.b    (a0)+
  667.     bne    1$
  668.     move.l    (a7)+,a0
  669. 3$    move.b    (a0)+,d0
  670.     beq    2$
  671.     mulu    #13,d1
  672.     bsr    to_upper
  673.     and.w    #$00FF,d0
  674.     add.w    d0,d1
  675.     and.w    #$7FF,d1
  676.     bra    3$
  677.  
  678. 2$    move.l    d1,d0
  679.     rts
  680.